/**
 * Vivien2
 *
 * Copyright (c) 2009 Alexei (aka Lancelot) Samsonov.
 * E-mail: alexey.v.samsonov@gmail.com; 
 *
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */


module environment;


import std.stdio;
import std.c.stdlib;


class Environment
{
	char[] get(char[] env)
	{
		char[] str;
		char* pstr;


		pstr = std.c.stdlib.getenv(&env[0]);


		if(pstr == null)
			return null;


		while(*pstr != '\0')
		{
			str ~= *pstr;
			pstr++;
		}
		
		return str;
	}


/*
	char[] get(char* penv)
	{
		char[] str;
		char* pstr = std.c.stdlib.getenv(penv);


		if(pstr == null)
			return null;


		while(*pstr != '\0')
		{
			str ~= *pstr;
			pstr++;
		}
		
		return str;
	}


*/
	void set()
	{
	}
}
